<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta charset="utf-8">
<title>供应商表</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport"
	content="width=device-width, initial-scale=1, maximum-scale=1">
<link rel="stylesheet" href="../../res/css/layui.css" media="all">
<link rel="stylesheet" href="../../res/css/cst/snproduction.css"
	media="all">
<script type="text/javascript" src="../../res/js/jquery-1.11.2.min.js"></script>
</head>
	<style type="text/css">
		.downpanel .layui-select-title span {
			line-height: 38px;
		}
		/*继承父类颜色*/
		.downpanel dl dd:hover {
			background-color: inherit;
		}
		
		.layui-table-page {
			position: fixed;
		}
		</style>
		<style type="text/css">
		body {
			height: 100%;
			width: 100%;
			background-size: cover;
			margin: 0 auto;
		}
		
		td {
			font-size: 12px !important;
		}
		
		.layui-form-checkbox span {
			width: 180px;
			height: 30px;
		}
		
		.layui-field-title {
			border-top: 1px solid white;
		}
		
		table {
			width: 100% !important;
		}
	</style>
	<body>
		<div class="demoTable" style="margin-left: 20px; margin-top: 10px;">
			类型名称:
			<div class="layui-inline">
				<input class="layui-input" style="height: 32px;" id="firmName"
					placeholder="根据供应商名称查询" autocomplete="off" maxlength="20">
			</div>
			<button class="layui-btn layui-btn-sm" data-type="reload" id="selectButton">搜索</button>
			<button class="layui-btn layui-btn-warm layui-btn-sm" id="insert">增加</button>
		</div>
	
		<table class="layui-table"
			lay-data="{url:'../../firm/query.action',page:true,id:'idTest'}"
			lay-filter="demo">
			<thead>
				<tr>
					<th lay-data="{type:'checkbox', fixed: 'left'}"></th>
					<th lay-data="{field:'firmId',align:'center'}">厂商ID</th>
					<th lay-data="{field:'firmName',align:'center'}">厂商名字</th>
					<th lay-data="{field:'firmAddress', align:'center',}">厂商地址</th>
					<th lay-data="{field:'isva', align:'center',templet:'#isvaTpl'}">是否有效</th>
					<th lay-data="{field:'optimr', align:'center',}">操作时间</th>
					<th lay-data="{field:'oper', align:'center',}">操作人</th>
					<th lay-data="{fixed: 'right', align:'center', toolbar: '#barDemo'}">操作</th>
				</tr>
			</thead>
		</table>
		<script type="text/javascript" id="isvaTpl">
			 {{# if(d.isva == 0) { }}
			    	<div>无效</div>
				 {{# } else if(d.isva == 1){ }}
			   	<div>有效</div>
			 {{# }}}
		</script>
		<script type="text/html" id="barDemo">
  			<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
  			<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
		</script>
	
		<!-- 增加或修改的弹框 -->
		<form id="myform" class="layui-form" method="post"
			style="margin-top: 10px;">
			<div id="addOrUpdate" style="display: none;">
				<input type="hidden" name="firmId" id="firmId" />
	
				<div class="aru">
					<label class="layui-form-label">厂商名:</label>
					<div class="layui-input-block">
						<input name="firmName" id="firmNames" maxlength="20" class="layui-input" type="text" onblur="firmN()" placeholder="xx有限公司"
						onkeyup="value=value.replace(/[\d]/g,'') " > 
					</div>
				</div>
				
				<div class="aru">
					<label class="layui-form-label">厂商地址:</label>
					<div class="layui-input-block">
						<input name="firmAddress" id="firmAddress" maxlength="20"  onblur="firmA()" class="layui-input" type="text"
						onkeyup="value=value.replace(/[^\w\u4E00-\u9FA5]/g, '')">
					</div>
				</div>
				
				<div class="aru">
					<label class="layui-form-label">是否有效:</label>
					    <div class="layui-input-block">
					      <select name="isva" id="isva" lay-filter="aih ao">
					        <option value=""></option> 
					        <option value="1">是</option>
					        <option value="0">否</option>
					      </select>
					    </div>
				</div>
	
				<div class="aru">
					<label class="layui-form-label">操作人:</label>
					<div class="layui-input-block">
						<input name="oper" id="oper" class="layui-input" onblur="op()" maxlength="5"type="text"
						onkeyup="value=value.replace(/[^\w\u4E00-\u9FA5]/g, '')">
					</div>
				</div>
				
				<div class="aru">
					<div class="layui-input-block">
						<input type="button" class="layui-btn" id="sub" value="确认提交" /> 
						<a href="javascript:exit();" class="layui-btn layui-btn-danger">关闭</a>
					</div>
				</div>
				
			</div>
		</form>
		<script type="text/javascript" src="../../res/layui.all.js"></script>
		<script type="text/javascript" src="../../res/js/cyz/snFirm.js"></script>
	</body>
</html>